import axios from "axios"
// import { v4 as uuid } from 'uuid'
// let token = ''
// if (window.localStorage.getItem('wyyx_token')) {
//     token = window.localStorage.getItem('wyyx_token')!
// } else {
//     token = uuid()
//     window.localStorage.setItem('wyyx_token', token)
// }
const request = axios.create({
    timeout: 10000
})

// 添加请求拦截器
request.interceptors.request.use((config) => {
    if (config.url?.indexOf('/api') !== -1) {
        config.headers!.userTempId ='031fdd59-1880-4bd5-bfd6-60d8085103fe'
    }

    return config;
})

//添加响应拦截器
request.interceptors.response.use(res => {

    return res.data.data
})
export default request